require'cgi'
require'open-uri'
def get_tiny_url(url)
  url=CGI::escape(url)
  open("http://tinyurl.com/api-create.php?url="+url).read
end
#example:
=begin
 irb(main):103:0> get_tiny_url("http://www.douban.com/people/hooopo/")
=> "http://tinyurl.com/c4pkwv"
=end